import pandas as pd
import spider as msd
from tqdm import tqdm

city = pd.read_json('CityCode.json')
listProvinceName = list(city["省名称"].unique())
list = []
for i in tqdm(listProvinceName):
    a = msd.GetData('province', 'province', i, migrationType='in',
                    date='2020-02-10', isExcel=False)
    list.append({"province": i, "data": a})
writer = pd.ExcelWriter('chinaProvince2020-02-10.xlsx')
for j in list:
    df = j['data']
    df.to_excel(writer, j["province"])
writer.save()
